<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="module:tenantUser:add">
				<i class="fa fa-plus"></i> 新增
			</a>
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="module:tenantUser:remove">
				<i class="fa fa-trash-o"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-info order-table">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permissionService.hasPermi('module:tenantUser:edit')}]];
        var removeFlag = [[${@permissionService.hasPermi('module:tenantUser:remove')}]];
        var prefix = ctx + "module/tenantUser"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "用户",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'userId', 
					title : '用户ID' 
				},
				{
					field : 'deptId', 
					title : '部门ID' 
				},
				{
					field : 'loginName', 
					title : '登录账号' 
				},
				{
					field : 'userName', 
					title : '用户昵称' 
				},
				{
					field : 'userType', 
					title : '用户类型（00系统用户）' 
				},
				{
					field : 'email', 
					title : '用户邮箱' 
				},
				{
					field : 'phonenumber', 
					title : '手机号码' 
				},
				{
					field : 'sex', 
					title : '用户性别（0男 1女 2未知）' 
				},
				{
					field : 'avatar', 
					title : '头像路径' 
				},
				{
					field : 'password', 
					title : '密码' 
				},
				{
					field : 'salt', 
					title : '盐加密' 
				},
				{
					field : 'status', 
					title : '帐号状态（0正常 1停用）' 
				},
				{
					field : 'delFlag', 
					title : '删除标志（0代表存在 2代表删除）' 
				},
				{
					field : 'loginIp', 
					title : '最后登陆IP' 
				},
				{
					field : 'loginDate', 
					title : '最后登陆时间' 
				},
				{
					field : 'createBy', 
					title : '创建者' 
				},
				{
					field : 'createTime', 
					title : '创建时间' 
				},
				{
					field : 'updateBy', 
					title : '更新者' 
				},
				{
					field : 'updateTime', 
					title : '更新时间' 
				},
				{
					field : 'remark', 
					title : '备注' 
				},
				{
					field : 'tenantId', 
					title : '企业Id' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>